Skip to content

Remove the forwards of moved modules - #121

Merged
haizhongzheng merged 2 commits into
mainfrom
remove-moved-shims
Nov 20, 2026
Merged

haizhongzheng merged 2 commits into
mainfrom
remove-moved-shims

Conversation

@haizhongzheng

@haizhongzheng haizhongzheng commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Change

hermit/ had both agent/ and agents/; agents/ and seven modules like it only forwarded old import paths to
where the code moved. Nothing in the repository imports them any more. This removes all eight and the helper they
used, hermit/_moved.py:

Old New
hermit.agents (.base, .cli, .react, .tools, .container, .login) hermit.agent.acting (.agent, .workspace, .react, .tools), hermit.environment.docker, hermit.agent.base.login
hermit.evolver hermit.agent.evolver
hermit.llm, hermit.backends hermit.agent.model.llm, hermit.agent.model.backends
hermit.trajectory hermit.agent.base.trajectory
hermit.agent.base.direct hermit.agent.model.direct
hermit.agent.base.container hermit.environment.docker
hermit.agent.environment hermit.environment

The first five were 0.1's paths, forwarded in 0.2 only. hermit.agent.base.direct and hermit.agent.base.container
were 0.2's modules, moved this release; by decision their forwards go too, with no release that warns first: code
outside the repository that imports them from 0.2 fails with ModuleNotFoundError and the CHANGELOG names the new
path. hermit.agent.environment was never released.

Core changes: only the forwarding modules; no implementation changes. Documentation: CHANGELOG (Unreleased,
Breaking: the table above, submodules included), docs/framework/agent-layers.md (the forwards are gone),
tests/selection.py (the removed paths), and the path in three Docker comments.

Validation

  • python -m pytest tests/core/test_task.py tests/core/test_selection.py tests/core/test_layers.py: 26 passed.
  • The new test_the_moved_modules_old_paths_are_gone (8 cases, 0.14 s) asserts each old path raises
    ModuleNotFoundError for that module itself. On main all 8 fail; with one forward put back but _moved.py gone,
    it fails too.
  • Imported every hermit module: none fails on a removed path. Searched hermit/, examples/, tests/, docs/,
    docker/, the YAML configs and pyproject.toml's entry point for the old paths (python -m hermit.backends
    launchers included): none left outside the CHANGELOG's history.
  • git diff --check passed. Not run: the full suite (no implementation changed); CI runs it.

Review

  • Tests and documentation cover the affected behavior, where applicable. See Validation and Change.
  • Commands, defaults, and public interfaces are consistent. A breaking import change, listed in the CHANGELOG with
    each new path.
  • Agents follow the agent layers:
    model calls through Layer 1, where an agent runs is its environment, a benchmark's own agent subclasses a core
    agent in its example folder. No agent is added or changed; tests/core/test_layers.py passed.
  • Shared logs and examples contain no credentials or private data.
  • Documentation-only: links the issue where it was discussed with the core team. N/A: the change removes code.

General checklist:

  • Core changes. Only the eight forwarding modules and hermit/_moved.py; no implementation changes (Change).
  • Agent layers. Answered above.
  • Implementation correctness and failures. An old path fails at import with that module named; no caller in
    the repository uses one (Validation).
  • Real execution paths and tests. The test imports each path as a caller would (importlib.import_module);
    the console script and the python -m hermit.agent.model.backends launchers still run.
  • Documentation. CHANGELOG (Unreleased, Breaking, with every new path), docs/framework/agent-layers.md,
    tests/selection.py and three Docker comments.
  • This description. Read end to end against the diff; every path and count checked.
  • Independent review (post-PR audit). A separate Codex session (gpt-6.2-sol, high) audited a7b68e57 against
    the general and test checklists. It confirmed no remaining caller and found two defects, both fixed in
    a30e62f9: the CHANGELOG left out where hermit.agents' submodules went, and the test passed when a forward
    remained but its helper was gone (it now checks the missing module's name). Its question, that
    hermit.agent.base.direct and hermit.agent.base.container were 0.2's modules and not this release's forwards
    only, is answered in Change: removed by decision, and the description no longer calls them unreleased.
    a30e62f9 itself (the CHANGELOG table and the test's name check) was not re-audited.

Test checklist (test_the_moved_modules_old_paths_are_gone):

  • Group and selection. In tests/core/test_task.py, which --changed selects for this change; no new helper or
    fixture.
  • Names. States the behaviour as a sentence.
  • Docstrings. The file's docstring covers it; the assertion's comment says why the module name is checked.
  • What it asserts. The ModuleNotFoundError a caller sees, for the old module itself. All 8 cases fail on
    main, and a forward put back without _moved.py fails it.
  • Real entry points and stand-ins. importlib.import_module, as any caller's import; no stand-ins.
  • Isolation. No files, network, sign-in or CLI.
  • Time and order. No clock, delay or order dependence.
  • Cost. 8 cases, 0.14 s in all.
  • Hygiene. No new imports; the now unused warnings import removed; nothing started.

🤖 Generated with Claude Code

haizhongzheng and others added 2 commits November 20, 2026 11:07
hermit.agents, hermit.evolver, hermit.llm, hermit.backends and hermit.trajectory forwarded for 0.2 only;
hermit.agent.base.direct, hermit.agent.base.container and hermit.agent.environment were added this release and never
shipped. Nothing in the repository imports them. hermit/_moved.py goes with them. The docs, the CHANGELOG and the
Docker comments name the new paths; a test checks the old ones are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…is missing

The CHANGELOG lists each removed path with its new one, hermit.agents' submodules included, and no longer calls
hermit.agent.base.direct and hermit.agent.base.container unreleased: they were 0.2's modules. The test checks the
ModuleNotFoundError names the old module, so a forward left behind without its helper fails it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@haizhongzheng
haizhongzheng merged commit 4103fab into main Nov 20, 2026
1 check passed
@haizhongzheng
haizhongzheng deleted the remove-moved-shims branch November 20, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant